/*
 * ComponentClasses.cpp
 *
 *  Created on: May 29, 2013
 *      Author: root
 */

#include "model/clases/ComponentClases.h"
#include "model/Connector.h"

ComponentClasses::ComponentClasses() {

}

ComponentClasses::ComponentClasses(const ComponentClasses & otroComponente) {
	setName(otroComponente.nombre);
	m_posX = otroComponente.m_posX;
	m_posY = otroComponente.m_posY;
	componentType = otroComponente.componentType;
}

ComponentClasses& ComponentClasses::operator=(const ComponentClasses& otro) {
	setName(otro.nombre);
	componentType = otro.componentType;
	m_posX = otro.m_posX;
	m_posY = otro.m_posY;
	return *this;
}

void ComponentClasses::addConnector(unsigned xRel, unsigned yRel, bool isAttribute, unsigned exitNumber) {

	Connector* conector= new Connector(this, isAttribute, xRel, yRel, exitNumber);
	isAttribute ? conectoresEntrantes.push_back(conector) :
			conectoresEntrantes.push_back(conector);
}

ComponentClasses::~ComponentClasses() {

}
